package main

import "fmt"

/*
问题：超额存、超额取、关闭后存、关闭后取
*/
func main() {
	ch := make(chan int, 5)
	ch <- 1
	ch <- 2
	//close(ch)
	//ch <- "Third" // panic
	v1 := <-ch
	v2 := <-ch
	v3 := <-ch
	//v4 := <-ch
	//v5 := <-ch
	fmt.Println("v1 is ", v1)
	fmt.Println("v2 is ", v2)
	fmt.Println("v3 is ", v3)
	//fmt.Println("v4 is ", v4)
	//fmt.Println("v5 is ", v5)
	fmt.Println(len(ch), cap(ch))
}
